/*
 * SwimRaceOrganizerAboutBox.java
 */

package swimraceorganizer;

import java.awt.Font;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.SwingConstants;

import org.jdesktop.application.Action;
import javax.swing.JTextArea;
import java.awt.SystemColor;

public class SwimRaceOrganizerAboutBox extends javax.swing.JDialog {

    public SwimRaceOrganizerAboutBox(java.awt.Frame parent) {
        super(parent);
        setResizable(false);
        setModal(true);
        initComponents();
        getRootPane().setDefaultButton(closeButton);
    }

    @Action public void closeAboutBox() {
        dispose();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        closeButton = new javax.swing.JButton();
        javax.swing.JLabel appTitleLabel = new javax.swing.JLabel();
        appTitleLabel.setHorizontalAlignment(SwingConstants.CENTER);
        javax.swing.JLabel versionLabel = new javax.swing.JLabel();
        javax.swing.JLabel appVersionLabel = new javax.swing.JLabel();
        javax.swing.JLabel homepageLabel = new javax.swing.JLabel();
        javax.swing.JLabel appHomepageLabel = new javax.swing.JLabel();
        javax.swing.JLabel appDescLabel = new javax.swing.JLabel();
        appDescLabel.setHorizontalAlignment(SwingConstants.CENTER);
        javax.swing.JLabel imageLabel = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(swimraceorganizer.SwimRaceOrganizerApp.class).getContext().getResourceMap(SwimRaceOrganizerAboutBox.class);
        setTitle("About S.A.M. Race Edition v1.2");
        setName("aboutBox");

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(swimraceorganizer.SwimRaceOrganizerApp.class).getContext().getActionMap(SwimRaceOrganizerAboutBox.class, this);
        closeButton.setAction(actionMap.get("closeAboutBox")); // NOI18N
        closeButton.setName("closeButton"); // NOI18N

        appTitleLabel.setFont(appTitleLabel.getFont().deriveFont(appTitleLabel.getFont().getStyle() | java.awt.Font.BOLD, appTitleLabel.getFont().getSize()+4));
        appTitleLabel.setText("S.A.M. Race Edition"); // NOI18N
        appTitleLabel.setName("appTitleLabel"); // NOI18N

        versionLabel.setFont(versionLabel.getFont().deriveFont(versionLabel.getFont().getStyle() | java.awt.Font.BOLD));
        versionLabel.setText(resourceMap.getString("versionLabel.text")); // NOI18N
        versionLabel.setName("versionLabel"); // NOI18N

        appVersionLabel.setText("1.2, build 117"); // NOI18N
        appVersionLabel.setName("appVersionLabel");

        homepageLabel.setFont(homepageLabel.getFont().deriveFont(homepageLabel.getFont().getStyle() | java.awt.Font.BOLD));
        homepageLabel.setText("Contact"); // NOI18N
        homepageLabel.setName("homepageLabel"); // NOI18N

        appHomepageLabel.setText("rollandsov@gmail.com"); // NOI18N
        appHomepageLabel.setName("appHomepageLabel"); // NOI18N

        appDescLabel.setText(resourceMap.getString("appDescLabel.text")); // NOI18N
        appDescLabel.setName("appDescLabel"); // NOI18N

        imageLabel.setIcon(resourceMap.getIcon("imageLabel.icon")); // NOI18N
        imageLabel.setName("imageLabel"); // NOI18N
        
        JLabel lblCopyright = new JLabel();
        lblCopyright.setFont(new Font("Tahoma", Font.PLAIN, 10));
        lblCopyright.setHorizontalAlignment(SwingConstants.CENTER);
        lblCopyright.setText("Copyright \u00A9 2010-2011, Rolland Sovarszki");
        lblCopyright.setName("appCopyright");
        
        JTextArea txtrSamIsA = new JTextArea();
        txtrSamIsA.setEditable(false);
        txtrSamIsA.setFont(new Font("Tahoma", Font.PLAIN, 10));
        txtrSamIsA.setBackground(SystemColor.control);
        txtrSamIsA.setText("SAM is a free software. It can be redistributed or modied under the terms of the GNU General Public License as published by the Free Software      Foundation; ");
        txtrSamIsA.setRows(12);
        txtrSamIsA.setLineWrap(true);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        layout.setHorizontalGroup(
        	layout.createParallelGroup(Alignment.LEADING)
        		.addGroup(layout.createSequentialGroup()
        			.addComponent(imageLabel)
        			.addPreferredGap(ComponentPlacement.RELATED)
        			.addGroup(layout.createParallelGroup(Alignment.LEADING)
        				.addGroup(layout.createParallelGroup(Alignment.TRAILING)
        					.addGroup(layout.createSequentialGroup()
        						.addComponent(appTitleLabel)
        						.addGap(118))
        					.addGroup(layout.createSequentialGroup()
        						.addGap(18)
        						.addGroup(layout.createParallelGroup(Alignment.LEADING)
        							.addComponent(txtrSamIsA, GroupLayout.PREFERRED_SIZE, 340, GroupLayout.PREFERRED_SIZE)
        							.addComponent(appDescLabel, GroupLayout.DEFAULT_SIZE, 360, Short.MAX_VALUE)
        							.addGroup(layout.createSequentialGroup()
        								.addGroup(layout.createParallelGroup(Alignment.LEADING)
        									.addComponent(versionLabel)
        									.addComponent(homepageLabel))
        								.addPreferredGap(ComponentPlacement.RELATED)
        								.addGroup(layout.createParallelGroup(Alignment.LEADING)
        									.addComponent(appHomepageLabel)
        									.addComponent(appVersionLabel))
        								.addGap(66))
        							.addComponent(closeButton))
        						.addContainerGap()))
        				.addGroup(Alignment.TRAILING, layout.createSequentialGroup()
        					.addComponent(lblCopyright, GroupLayout.PREFERRED_SIZE, 270, GroupLayout.PREFERRED_SIZE)
        					.addGap(55))))
        );
        layout.setVerticalGroup(
        	layout.createParallelGroup(Alignment.LEADING)
        		.addGroup(layout.createSequentialGroup()
        			.addGroup(layout.createParallelGroup(Alignment.LEADING)
        				.addGroup(layout.createSequentialGroup()
        					.addContainerGap()
        					.addComponent(appTitleLabel)
        					.addPreferredGap(ComponentPlacement.RELATED)
        					.addComponent(appDescLabel)
        					.addPreferredGap(ComponentPlacement.RELATED)
        					.addGroup(layout.createParallelGroup(Alignment.BASELINE)
        						.addComponent(versionLabel)
        						.addComponent(appVersionLabel))
        					.addPreferredGap(ComponentPlacement.RELATED)
        					.addGroup(layout.createParallelGroup(Alignment.BASELINE)
        						.addComponent(homepageLabel)
        						.addComponent(appHomepageLabel))
        					.addPreferredGap(ComponentPlacement.RELATED)
        					.addComponent(lblCopyright)
        					.addGap(11)
        					.addComponent(txtrSamIsA, GroupLayout.PREFERRED_SIZE, 48, GroupLayout.PREFERRED_SIZE)
        					.addGap(18)
        					.addComponent(closeButton))
        				.addComponent(imageLabel, GroupLayout.PREFERRED_SIZE, 212, GroupLayout.PREFERRED_SIZE))
        			.addContainerGap(49, Short.MAX_VALUE))
        );
        getContentPane().setLayout(layout);

        pack();
    }// </editor-fold>//GEN-END:initComponents
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton closeButton;
}
